package com.ktjy.car.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ktjy.car.entity.Login;
import com.ktjy.car.mapper.LoginMapper;
import com.ktjy.car.service.LoginService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Resource
    private LoginMapper loginMapper;

    @Override
    public int login(Login login) {
        QueryWrapper<Login> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("account",login.getAccount());
        queryWrapper.eq("password",login.getPassword());
        return Math.toIntExact(loginMapper.selectCount(queryWrapper));
    }
}
